package cn.cvs.patten.Test;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @auth 邝志豪
 * @date 2024/1/8 11:44
 */
public class IntermedirayIncocation implements InvocationHandler {
    private  Object target;

    public Object getTarget() {
        return target;
    }

    public void setTarget(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("ProxyBuyer看房前。。。找房源");
        Object result =method.invoke(target, args);
        System.out.println("ProxyBuyer看房后。。。签合同");
        return result;
    }
}
